<?php


require_once('jsmin-1.1.1.php');

$path = dirname(dirname(__FILE__));
$jsPath = $path."/js/";

echo "Using path: $path\n";


$js = "";


$files = array(
    'toolbox.js',
    'console.js',
    'layout.js',
    'loading-msg.js',
    'map.js',
    'listings.js',
    'wp_posts.js',
    'space-polygon.js',
    'lightbox.js',
    'zoom-reminder.js',
    'export.js',
    'elabel.js',
    'labels.js'
);

foreach($files as $file) {
    echo "Processing ".$jsPath.$file."\n";
	
	if(file_exists($jsPath.$file))
	    $js .= JSMin::minify(file_get_contents($jsPath.$file));
}




// Output the file first instead of passing the code directly to google in case we exceed their size limit
file_put_contents($jsPath."combined.js", $js);
?>
